<?php
require_once 'Sabai/Controller/ModelEntityDelete.php';

class Xigg_Admin_Tag_Delete extends Sabai_Controller_ModelEntityDelete
{
    function Xigg_Admin_Tag_Delete()
    {
        $url = array('base' => '/tag');
        $options = array('successURL' => $url, 'errorURL' => $url);
        parent::Sabai_Controller_ModelEntityDelete('Tag', 'id', $options);
    }

    function _onDeleteEntity(&$entity, &$context)
    {
        $context->response->setVar('breadcrumb_current', _('Delete tag'));
        return true;
    }

    function &_getFormFromEntity(&$entity)
    {
        $form =& parent::_getFormFromEntity($entity);
        $form->removeElement('Nodes');
        return $form;
    }
}